package com.csp.session;

import java.sql.Connection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * sql会话
 *
 * @author:chengsp
 * @createTime:2019/8/22 13:00
 */
public interface SqlSession {

    <T> T selectOne(String sql, ExecuteMsg executeMsg);

    <T> List<T> selectList(String sql, ExecuteMsg executeMsg);

    <T> Set<T> selectSet(String sql, ExecuteMsg executeMsg);

    <K, V> Map<K, V> selectMap(String sql, ExecuteMsg executeMsg);

    <K, V> List<Map<K, V>> selectMapList(String sql, ExecuteMsg executeMsg);

    <K, V> Set<Map<K, V>> selectMapSet(String sql, ExecuteMsg executeMsg);

    int insert(String sql, ExecuteMsg executeMsg);

    int update(String sql, ExecuteMsg executeMsg);

    int delete(String sql, ExecuteMsg executeMsg);

    void close();

    void startTransaction();

    void commit();

    Connection getConnection();
}
